package com.thb.pay.manage.comm.config;

import com.thb.pay.core.config.WebConfig;
import com.thb.pay.manage.comm.interceptor.AuthenticationInterceptor;
import com.thb.pay.manage.comm.interceptor.OperationLogInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;

/**
 * @auther lucky
 * @date: 2019/8/19 10:50
 * @Description:
 */
@Configuration
public class AdminWebConfig extends WebConfig {

    @Autowired
    private AuthenticationInterceptor authenticationInterceptor;

    @Autowired
    private OperationLogInterceptor operationLogInterceptor;

    @Override
    protected void addCustomInterceptors(InterceptorRegistry registry) {
        super.addCustomInterceptors(registry);
        logger.info("<<<<<<<<<<<<<<<<<init.authentication.interceptor>>>>>>>>>>>>>>>>");

        registry.addInterceptor(authenticationInterceptor);
        registry.addInterceptor(operationLogInterceptor);
    }
}